<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <!-- 开发环境版本 -->
    <script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
  </head>
  <body>
    <!-- 
        v-html：
                设置元素的innerHTML
                内容中有html结构会被解析为标签
                v-text只会解析成文本
     -->
    <div id="app">
      <p v-html="content"></p>
      <p v-text="content"></p>
    </div>
    <script>
      var app = new Vue({
        el: "#app",
        data: {
          content: "<a href='http://www.baidu.com'>小母猪</a>",
        },
      });
    </script>
  </body>
</html>
